package inttest;

import java.math.BigDecimal;

/**
 * created by flyketch
 * 19-9-25 上午10:08
 */
public class CompareIntTest {

    public static void main(String[] args) {
        int a = 3;
        int b = 3;
        if (a == b) {
            System.out.println("a == b");
        } else {
            System.out.println("a != b");
        }

        Integer c = 3;
        Integer d = 3;
        if (c == d) {
            System.out.println("c == d");
        } else {
            System.out.println("c != d");
        }

        if (c.equals(d)) {
            System.out.println("true");
        } else {
            System.out.println("false");
        }

        BigDecimal e = new BigDecimal(3);
        BigDecimal f = new BigDecimal(3);
        if (e == f) {
            System.out.println("e == f");
        } else {
            System.out.println("e != f");
        }

        if (e.equals(f)) {
            System.out.println("true");
        } else {
            System.out.println("false");
        }

        if (c.equals(f)) {
            System.out.println("true");
        } else {
            System.out.println("false");
        }

        if (c.equals(a)) {
            System.out.println("true");
        } else {
            System.out.println("false");
        }

        if (c == a) {
            System.out.println("true");
        } else {
            System.out.println("false");
        }

        Object o1 = 3;
        Object o2 = 3;

        if (o1.equals(o2)) {
            System.out.println("--> true");
        } else {
            System.out.println("---> false");
        }

        if (o1 == o2) {
            System.out.println("-> true");
        } else {
            System.out.println("-> false");
        }
    }
}
